package com.zrrd.learn.chapter09.collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

/**
 * 线性存储结构
 *
 * @author wrn
 * @version 1.0
 * @date 2023/8/15 13:36
 */

public class LearnLine {

    public static void main(String[] args) {

        List<Integer> list = new ArrayList<>(28);

        List<Integer> integers = Arrays.asList(1,2,3,4);
        integers.set(0,5);

        System.out.println(integers);
        List<Integer> list1 = new LinkedList<>(list);

        //        Object 其它类的关系
        //1 object 引用 顶层
        //2 Object也可以接收任何一个类的实例

        list.add(23);
        list.add(3);
        list.add(5);
        list.add(1);
        list.add(4);

        System.out.println(list.get(4));

        System.out.println(list.contains(6));

        list.remove(4);

        System.out.println(list.get(0));

        System.out.println(list);
    }

}
